package com.bjwl.service.impl;

import com.bjwl.dao.DailyMapper;
import com.bjwl.pojo.Daily;
import com.bjwl.pojo.Staff;
import com.bjwl.service.DailyService;
import com.bjwl.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: dzx
 * @Date:Create：in 2020/4/19 22:01
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Service
public class DailyServiceImpl implements DailyService {

    @Autowired
    private DailyMapper dailyMapper;

    /*总店 begin*/
    @Override
    public PageBean<Daily> showDaily(Integer pageNum, String content) {
        PageBean<Daily> pageBean = new PageBean<Daily>(pageNum,10,dailyMapper.getAdminTotalRecord(content));
        pageBean.setData(dailyMapper.adminFindAllDaily(pageBean,content));
        return pageBean;
    }

    /*总店 end*/

    @Override
    public void addDaily(Daily daily) {
        dailyMapper.addDaily(daily);
    }

    @Override
    @Transactional
    public PageBean<Daily> brFindAllDaily(Integer pageNum, Integer bsid, String content) {
        PageBean<Daily> dailyPageBean = new PageBean(pageNum,12,dailyMapper.brAdminTotalRecord(bsid,content));
        dailyPageBean.setData(dailyMapper.brFindAllDaily(bsid,content,dailyPageBean));
        return dailyPageBean;
    }




}
